package cn.twh.wall;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import springfox.documentation.swagger2.annotations.EnableSwagger2;

@SpringBootApplication(scanBasePackages= {"cn.twh"})
@EnableSwagger2
public class ServerStart {
	private static final Logger log=LoggerFactory.getLogger(ServerStart.class);
	public static void main(String[] args) {
		try {
			SpringApplication.run(ServerStart.class, args);
			// 可以尝试增加钩子，在jvm停止时执行指定线程方法
			Runtime.getRuntime().addShutdownHook(new Thread(()->{
				System.out.println("ShutDown hook");
			}));
		}catch (Exception e) {
			log.info("START ERROR");
			return ;
		}
		log.info("START OVER");
	}
}
